import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 首页获取订单列表
 * @param query
 * @returns {*}
 */
export const getOrderList = (query?: orderList): AxiosPromise<orderList[]> => {
  return request({
    url: '/report/order/orderList',
    method: 'get',
    params: query
  });
};

/**
 * 首页获取产品订单销售额列表
 * @param query
 * @returns {*}
 */
export const getProductOrderSort = (query?: orderList): AxiosPromise<orderList[]> => {
  return request({
    url: '/report/order/productOrderSort',
    method: 'get',
    params: query
  });
};

/**
 * 首页获取订单信息列表
 * @param query
 * @returns {*}
 */
export const getOrderMsgList = (query?: orderList): AxiosPromise<orderList[]> => {
  return request({
    url: '/report/order/orderMsgList',
    method: 'get',
    params: query
  });
};

/**
 * 首页获取订单信息列表
 * @returns {*}
 */
export const getWWP = (): AxiosPromise<wwp> => {
  return request({
    url: '/report/wwp/getWWP',
    method: 'get',
  });
};

/**
 * 首页获取订单信息列表
 * @returns {*}
 */
export const getStockList = (): AxiosPromise<stockList> => {
  return request({
    url: '/report/stock/getList',
    method: 'get',
  });
};

/**
 * 首页获取订单信息列表
 * @returns {*}
 */
export const getBillList = (query?: billList): AxiosPromise<billList> => {
  return request({
    url: '/report/bill/getList',
    method: 'get',
    params: query
  });
};

/**
 * 首页获取订单信息列表
 * @returns {*}
 */
export const getFmsAccount = (): AxiosPromise<billList> => {
  return request({
    url: '/report/bill/getAccount',
    method: 'get',
  });
};

export interface orderList extends  BaseEntity{
  date?: any;
  typeIds?: number[];
  dateRange?: string;
  productName?: string;
  costMoney?: number;
  totalMoney?: number;
  discountMoney?: number;

  typeId?:number;
  msgNumber?: number;
}

export interface wwp{
  warnTotal?: number;
}

export interface stockList{
  name?: number;
  value?: string;
}

export interface billList extends  BaseEntity{
  name?: number;
  value?: string;
}
